CC = gcc
CPP = g++
RM = rm

SRC_PATH := .

TARGET := ori_pagerank

CFLAGS += $(foreach dir, $(INCLUDE_PATH), -I$(dir))
SRCS += $(wildcard $(SRC_PATH)/ori_pagerank.cpp)
OBJS := $(notdir $(SRCS:.cpp=.o))

build:
	$(CPP) -c $(CFLAGS) $(SRCS)
	$(CPP) -c ./float16_trans.cpp
	$(CPP) $(CFLAGS) -o float16_trans float16_trans.o
	$(CPP) $(CFLAGS) -o $(TARGET) $(OBJS)
	$(RM) $(OBJS) float16_trans.o

clean:
	$(RM) $(OBJS) $(TARGET)

run:
	./$(TARGET)

wiki_run:
	./$(TARGET) ../../data/edge_off_wiki.txt ../../data/edge_list_wiki_reorder_64bram_32pipe.txt ../../data/degree_wiki_reorder_64bram_32pipe.txt 100 ./wiki_ori_pr_result

orkut_run:
	./$(TARGET) ../../data/edge_off_orkut.txt ../../data/edge_list_orkut_reorder_64bram_32pipe.txt ../../data/degree_orkut_reorder_64bram_32pipe.txt 100 ./orkut_ori_pr_result